/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qjs.smterp.model;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vostro 3400
 */
@Entity
@Table(name = "tb_goods")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Goods.findAll", query = "SELECT g FROM Goods g"),
    @NamedQuery(name = "Goods.findByGoodsId", query = "SELECT g FROM Goods g WHERE g.goodsId = :goodsId"),
    @NamedQuery(name = "Goods.findByGoodsCode", query = "SELECT g FROM Goods g WHERE g.goodsCode = :goodsCode"),
    @NamedQuery(name = "Goods.findByGoodsName", query = "SELECT g FROM Goods g WHERE g.goodsName = :goodsName")})
public class Goods extends BasePojo {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "GOODS_ID")
    private Integer goodsId;
    
    @Basic(optional = false)
    @Column(name = "GOODS_CODE")
    private String goodsCode;
    @Column(name = "GOODS_NAME")
    private String goodsName;
    @Column(name = "GOODS_CODE_INTER")
    private String goodsCodeInter;
    @Column(name = "GOODS_NAME_INTER")
    private String goodsNameInter;
    @Column(name = "SPECIFICATION")
    private String specification;
    @Column(name = "FORMULA")
    private String formula;
    @Column(name = "GOODS_DETAIL_ID")
    private Integer goodsDetailId;
    
    @Column(name = "UNIT_ID")
    private Integer unitId;
    @Column(name = "UNIT_NAME")
    private String unitName;
    
   
    public Goods() {
    }

    public Goods(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Goods(Integer goodsId, String goodsCode) {
        this.goodsId = goodsId;
        this.goodsCode = goodsCode;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsCodeInter() {
        return goodsCodeInter;
    }

    public void setGoodsCodeInter(String goodsCodeInter) {
        this.goodsCodeInter = goodsCodeInter;
    }

    public String getGoodsNameInter() {
        return goodsNameInter;
    }

    public void setGoodsNameInter(String goodsNameInter) {
        this.goodsNameInter = goodsNameInter;
    }

    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public Integer getGoodsDetailId() {
        return goodsDetailId;
    }

    public void setGoodsDetailId(Integer goodsDetailId) {
        this.goodsDetailId = goodsDetailId;
    }

    
	/**
	 * @return the unitId
	 */
	public Integer getUnitId() {
		return unitId;
	}

	/**
	 * @param unitId the unitId to set
	 */
	public void setUnitId(Integer unitId) {
		this.unitId = unitId;
	}

	/**
	 * @return the unitName
	 */
	public String getUnitName() {
		return unitName;
	}

	/**
	 * @param unitName the unitName to set
	 */
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (goodsId != null ? goodsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Goods)) {
            return false;
        }
        Goods other = (Goods) object;
        if ((this.goodsId == null && other.goodsId != null) || (this.goodsId != null && !this.goodsId.equals(other.goodsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qjs.smterp.model.Goods[ goodsId=" + goodsId + " ]";
    }
    
}
